package com.kefu.boss.vo;

import org.apache.commons.lang3.StringUtils;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.kefu.common.vo.AbstractSearchVo;
import com.kefu.boss.model.BossUser;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@ApiModel(description = "")
public class BossUserSearchVo extends AbstractSearchVo {
    @ApiModelProperty(value = "名称")
    private String userName;
    @ApiModelProperty(value = "邮箱")
    private String userEmail;
	@ApiModelProperty(value = "状态：0停用，1启用")
	private Integer userStatus;

	@Override
    public  LambdaQueryWrapper<BossUser> lambdaQuery(){
    	LambdaQueryWrapper<BossUser> wrapper=Wrappers.<BossUser>lambdaQuery();
	    wrapper.like(StringUtils.isNotBlank(userName), BossUser::getUserName, userName);//名称
	    wrapper.like(StringUtils.isNotBlank(userEmail), BossUser::getUserEmail, userEmail);//邮箱
	    wrapper.eq(userStatus!=null, BossUser::getUserStatus, userStatus);
    	return wrapper;
	}
}